/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.game.stepbystep;

import java.io.IOException;

/**
 *
 * @author zinin
 */
public class StateCharacterSeleted extends State{

    private GameLayerManager context;
    
    StateCharacterSeleted(GameLayerManager aThis) {
        context = aThis;
    }

    public void onCanvasDrawing(){
        try {
            context.gameDesign.getSelmark().setVisible(true);
            context.gameDesign.getSelmark().setPosition(context.gameDesign.getFatman().getX(), 
                    context.gameDesign.getFatman().getY() - MIDPCanvas.GRID_WIDTH);
            context.gameDesign.getSelmark().nextFrame();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    public boolean isAllowDragging() {
        return false;
    }

    public void onTapScreen(int x, int y) {
        context.setState(context.STATE_CHARDIRECTED);
        context.onTapScreen(x, y);
    }

    public String id() {
        return "selected";
    }
}
